home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
doors_1
/
moretim1.zip
/
MORETIME.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-12-19
|
6KB
|
141 lines
'+--------------------------[ MoreTime Ver 1.10 ]----------------------------+
'| Written By Gary Meeker 12/18/91 Updated 12/19/91 |
'| SYSOP: SHARP Technical Support Line BBS Lawrenceville, GA |
'| (404) 962-1788 300/1200/2400/9600 Baud. 24 Hours |
'+---------------------------------------------------------------------------+
'V1.0 12/18/91 - Initial release
'V1.1 12/19/91 - Noticed I left off the LEN = 25 for the database file.
' - Removed PCBDOOR.TXT from .CFG file and onto command line
' to make multi-node setup easier
' - Added Bytes Increase value (based on 2400 baud)
'-----------------------------------------------------------------------------
DEFINT A-Z
' QuickPack Declarations
DECLARE SUB SetLevel (ErrLevel%)
DECLARE SUB FCopy (Source$, Dest$, Buffer$, ErrCode%)
DECLARE FUNCTION Exist% (FileName$)
DECLARE FUNCTION PDQParse$ (Work$)
' Local Declarations
DECLARE FUNCTION CheckDataBase(UserName$, Recs, FileHandle)
TYPE PCBSYSRECORD
Display AS STRING * 2 'Display On/Off ("-1" = On, " 0" = Off)
Printer AS STRING * 2 'Printer On/Off ("-1" = On, " 0" = Off)
PageBell AS STRING * 2 'Page Bell On/Off ("-1" = On, " 0" = Off)
CallAlarm AS STRING * 2 'Caller Alarm On/Off ("-1" = On, " 0" = Off)
SysopFlag AS STRING * 1 'Sysop Flag (" ", "N"=sysop next, "X"=exit dos)
ErrCorr AS STRING * 2 'Error Corrected ("-1" = On, " 0" = Off)
Graphics AS STRING * 1 'Graphics Mode ('Y'=yes, 'N'=no, '7'=7E1)
NodeChat AS STRING * 1 'Node Chat Status ('A'=available, 'U'=unavailable)
DTEPort AS STRING * 5 'DTE Port Speed (PC to Modem speed)
Connect AS STRING * 5 'Connect Speed shown to caller or "Local"
RecNum AS INTEGER 'User's Record Number in the USERS file
FirstName AS STRING * 15 'User's First Name (padded to 15 characters)
Password AS STRING * 12 'User's Password (padded to 12 characters)
TimeOn AS INTEGER 'Time User Logged On (in minutes since midnight)
TimeUsed AS INTEGER 'Time used so far today (negative number of minutes)
TimeOnF AS STRING * 5 'Time User Logged On (in "HH:MM" format)
DayTime AS INTEGER 'Time Allowed On (from PWRD file) (see note 1 below)
DLKbytes AS INTEGER 'Allowed K-Bytes for Download (see note 2 below)
ConfArea AS STRING * 1 'Conference Area user was in (if <= 255)
ConfJoined AS STRING * 5 'Conference Areas the user has joined this session
ConfScaned AS STRING * 5 'Conference Areas the user has scanned this session
ConfAddTime AS INTEGER 'Conference Add Time in minutes
CreditTime AS INTEGER 'Upload/Sysop CHAT Credit Minutes (see note 3 below)
LangExt AS STRING * 4 'Language Extension (see note 4 below)
UserName AS STRING * 25 'User's Full Name (padded to 25 characters)
MinRemain AS INTEGER 'Calculated Minutes Remaining (see note 5 below)
NodeNum AS STRING * 1 'Node Number (or ' ' if no network)
EventTime AS STRING * 5 'Scheduled Event Time (in "HH:MM" format)
EventOn AS STRING * 2 'Is Event Active ("-1" = On, " 0" = Off)
EventSlide AS STRING * 2 'Slide Event ("-1" = On, " 0" = Off)
MemMesg AS SINGLE 'Memorized Message Number
ComPort AS STRING * 1 'Comm Port Number (0=none, 1-8)
Reserved1 AS STRING * 1 'Reserved for PCBoard
Reserved2 AS STRING * 1 'Reserved for PCBoard
ANSI AS STRING * 1 'Use ANSI (1 = Yes, 0 = No)
EventDate AS STRING * 8 'Last Event Date (in "MM-DD-YY" format)
EventMin AS INTEGER 'Last Event Minute (in minutes since midnight)
ExitToDOS AS STRING * 1 'Caller Exited to DOS (1 = Yes, 0 = No)
EventDue AS STRING * 1 'Event Up Coming (1 = Yes, 0 = No)
StopUploads AS STRING * 1 'Stop Uploads (1 = Yes, 0 = No)
ConfAreaIn AS INTEGER ' Conference Area user was in (up to 65535)
END TYPE
FUNCTION CheckDataBase(UserName$, Recs, FileHandle)
DIM CheckName AS STRING * 25
FOR X = 1 TO Recs
GET #FileHandle, X, CheckName$
IF UserName$ = CheckName$ THEN
CheckDataBase = 1
EXIT FUNCTION
END IF
NEXT X
PUT #FileHandle, Recs + 1, UserName$
CheckDataBase = 0
END FUNCTION
DIM PCBSYS AS PCBSYSRECORD, Buffer AS STRING * 8192
ConfigFile$ = "MORETIME.CFG"
IF NOT Exist(ConfigFile$) THEN 'Check for Config file
PRINT CHR$(34); ConfigFile$; CHR$(34); " not found!"
SetLevel 20 'Return error code
END
ELSE
OPEN ConfigFile$ FOR INPUT AS #1
INPUT #1, DataBaseFile$
INPUT #1, BadTextFile$
INPUT #1, GoodTextFile$
INPUT #1, TimeIncrease
INPUT #1, KBytesIncrease
CLOSE #1
END IF
C$ = COMMAND$
PCBDir$ = PDQParse$(C$) 'Get the PCBOARD.SYS location from Command Line
IF RIGHT$(PCBDir$, 1) <> "\" THEN PCBDir$ = PCBDir$ + "\"
SysFile$ = PCBDir$ + "PCBOARD.SYS"
DoorTextFile$ = PCBDir$ + "PCBDOOR.TXT"
Failed = 0
PRINT "MoreTime 1.10....Checking "; CHR$(34); SysFile$; CHR$(34)
IF NOT Exist(SysFile$) THEN 'Check for PCBOARD.SYS file
PRINT CHR$(34); SysFile$; CHR$(34); " not found!"
SetLevel 10 'Return error code
ELSE
OPEN SysFile$ FOR BINARY AS #1
GET #1,, PCBSYS
PRINT "User: "; PCBSYS.UserName$
IF Exist(DataBaseFile$) THEN
OPEN DataBaseFile$ FOR RANDOM AS #2 LEN = 25
Recs = LOF(2) \ 25
Failed = CheckDataBase(PCBSYS.UserName$, Recs, 2)
CLOSE #2
END IF
IF Failed THEN
PRINT "User has already accessed the Door!"
TextFile$ = BadTextFile$
SetLevel 1 'Return error code
ELSE
PRINT "User granted additonal Time & Bytes."
TextFile$ = GoodTextFile$
PCBSYS.CreditTime = PCBSYS.CreditTime + TimeIncrease
Connect = VAL(PCBSYS.Connect$)
PRINT "Connect:"; Connect
IF Connect = 0 THEN Connect = 2400
Adjusted = KBytesIncrease * (Connect \ 2400)
PRINT "Adjusted Bytes by:"; Adjusted
PRINT "Was:"; PCBSYS.DLKBytes
PCBSYS.DLKBytes = PCBSYS.DLKBytes + Adjusted
PRINT "Now:"; PCBSYS.DLKBytes
PUT #1,1, PCBSYS
END IF
FCopy TextFile$, DoorTextFile$, Buffer$, ErrCode%
CLOSE
END IF